package com.zeratul.common.lock.lock.base;


import com.zeratul.common.lock.annotation.ZtLockType;

/**
 * 分布式锁抽象类
 */
public abstract class BaseZtLock {

    /**
     * 阻塞式加锁
     * @param dLockType
     * @param key
     */
    public abstract void lock(ZtLockType dLockType, String key);

    /**
     * 非阻塞式加锁
     */
    public abstract boolean tryLock(ZtLockType ztLockType, String key, Integer timeout);

    /**
     * 解锁
     */
    public abstract void unlock();
}
